﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data.Objects.DataClasses;

namespace GNSCore.Model.Context
{
    /// <summary>
    /// Interface, for testing needs
    /// </summary>
    public interface IGNSContext : IDisposable
    {
        void AcceptAllChanges();
        void AddObject(string entitySetName, object entity);
        void ApplyPropertyChanges(string entitySetName, object changed);
        void AttachTo(string entitySetName, object entity);
        void Attach(IEntityWithKey entity);
        EntityKey CreateEntityKey(string entitySetName, object entity);
        //IQueryable<T> CreateQuery<T>();
        void DeleteObject(object entity);
        void Detach(object entity);
        object GetObjectByKey(EntityKey key);
        void Refresh(RefreshMode refreshMode, IEnumerable collection);
        void Refresh(RefreshMode refreshMode, object entity);
        int SaveChanges();
        int SaveChanges(bool acceptChangesDuringSave);
        bool TryGetObjectByKey(EntityKey key, out object value);
        IQueryable<T> CreateQuery<T>();
        event EventHandler SavingChanges;
        void Dispose();
    }
}